fix(web): prevent silent opening mutation repeats - #646
Merged
Conversation
🦋 Changeset detectedLatest commit: 37e6e6e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
commit: |
ScriptedAlchemy
added a commit
that referenced
this pull request
Sep 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
in-flight,succeeded,failed-unknown) from the 64-entry opening-result cache.readOnlyHint: trueopening tools live on every page load and document the policy in English and Chinese.Chosen model
Bounded execution tombstones separate from cached results. This preserves the existing automatic opening experience for the first call while removing silent repeat authority; rejecting every automatic mutation opening would be a materially broader behavior break. The execution ledger is capped at 256 and fails closed when full, while results remain independently capped at 64.
Tests
pnpm buildpnpm typecheckpnpm lintpnpm test:unit— 4,148 passed, 6 skippedpnpm docs:site:build— locale parity and 0 broken linksDeslop
GPT-5.6 Sol, 1 edit — promoted the fail-closed warning from result-only text to an explicit host-visible status so an interactive App cannot hide the safety state.
Self-review
Reviewer:
claude-fable-5-1-thinking-high(change-risk-reviewer) over90b411b0dvsorigin/main.Findings and dispositions:
0a26c5979: the route-owned close watcher now remains subscribed until actual session close, and the session test double exercises close notifications. A 257-retirement regression test proves records are reclaimed after the final page lease releases.#unavailableOpeningCallreturned the narrower base type. Fixed: it now returnsWebOpeningCalldirectly.Second review at
0a26c5979: no merge-blocking risks. One low stale-session replacement race was fixed in8a44043d5by checking the resolved session id and current map promise before deleting; its regression test proves the replacement remains registered for later retirement. One low dead-session close race was dismissed: it can consume at most one bounded fail-closed slot per narrow rebuild/request race and cannot authorize a repeat.Final review at
8a44043d5: no concrete merge risks found. The async close guard cannot skip a closed current session or delete a replacement and is safe with epoch adoption and route shutdown. Two low residuals were dismissed: a close-time microtask window can produce one fail-closed 502 without reaching mutation execution, and direct external-close guard coverage is optional because the replacement and 257-retirement tests exercise both identity and cleanup invariants.Post-main-merge review at
37e6e6e78: no concrete merge risks; the merged main delta is disjoint and all authority, lifecycle, warning, docs, and changeset invariants remain intact. The previously dismissed one-request fail-closed 502 microtask window is unchanged.Auto-merge remains unarmed until latest-head CI and threads are green.